const {getTrainingPlans} = require('../../utils/api');
Component({
  data: {
    navList: [
      {title: '身体评估', color: 'item-logo green', icon: '/images/user.png', path: ''},
      {title: '全部课程', color: 'item-logo blue-link', icon: '/images/user.png', path: ''},
      {title: '练动作', color: 'item-logo blue', icon: '/images/user.png', path: ''},
      {title: '排行榜', color: 'item-logo red', icon: '/images/user.png', path: ''}
    ],
    planes: {
      basicInfo: {
        title: '个性增肌计划',
        duration: '8周',
        frequency: '每周6天',
        sportTime: '每天 20 - 30 分钟'
      },
      list: [ [], [{title: '15 分钟暴爽虐腹', type: '训练', time: '15分钟'}, {title: '8 分钟站立 Hit 训练', type: '训练', time: '8分钟'}], [], []]
    },
    filterObj: {
      main:[
        {icon: '/images/user.png', label: '精选'},
        {icon: '', label: '燃脂舞'},
        {icon: '/images/user.png', label: '普拉提'},
        {icon: '/images/user.png', label: '跳操'},
        {icon: '/images/user.png', label: 'hit'}
      ],
      other: [
        [{label:'大重量', isSelected: false}, {label:'小重量', isSelected: false}, {label:'无器械', isSelected: false}],
        [{label:'困难', isSelected: false}, {label:'一般', isSelected: false}, {label:'简单', isSelected: false}],
        [{label:'室内', isSelected: false}, {label:'室外', isSelected: false}]
      ]
    },
    coursesList: [
      {video: '', level: 'k3', rate: '4.5', time: '31分钟', title: '无敌减脂操', tags: ['官方精品', '官方精品', '官方精品'], hot: '一天消耗 400 大卡!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!！！', avatar: '', nickName: '张三'},
      {video: '', level: 'k3', rate: '4.5', time: '31分钟', title: '无敌减脂操', tags: ['官方精品'], hot: '一天消耗 400 大卡！！', avatar: '', nickName: '张三'},
      {video: '', level: 'k3', rate: '4.5', time: '31分钟', title: '无敌减脂操', tags: ['官方精品'], hot: '一天消耗 400 大卡！！', avatar: '', nickName: '张三'},
      {video: '', level: 'k3', rate: '4.5', time: '31分钟', title: '无敌减脂操', tags: ['官方精品'], hot: '一天消耗 400 大卡！！', avatar: '', nickName: '张三'},
      {video: '', level: 'k3', rate: '4.5', time: '31分钟', title: '无敌减脂操', tags: ['官方精品'], hot: '一天消耗 400 大卡！！', avatar: '', nickName: '张三'},
    ]
  },
  lifetimes: {
    attached: async function() {
      const res = await getTrainingPlans();
      console.log(res)
    }
  },
  methods: {
    switchTab(e) {
      const path = e.currentTarget.dataset.path;
    },
    filterTab(e) {
      const {main, other} = e.detail;
      console.log(main, other)
    }
  }
})